package com.example.quartz;

import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class RestJob   extends QuartzJobBean {

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDetail jobDetail=jobExecutionContext.getJobDetail();
        JobDataMap jobDataMap=jobDetail.getJobDataMap();
        SysJob sysJob =(SysJob)jobDataMap.get("sysjob");
        try {
            if("2".equals(sysJob.getTypeCode().toString())){
                String url=sysJob.getRest();
                //执行
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
